package com.training.java.core.exceptions;

/**
 * Objective:Transfer the ammount from checkingsAccount to savingsAccount. If
 * the transfer ammount is more than checkingAccount then
 * " InSufficiantBalanceExceptionException" should raise.
 * 
 * @author Satya
 * 
 */
public class BankCustomer {

	public static void main(String[] args) {

		// Instantiate TransferService
		// Instantiate InSufficiantBalanceExceptionException

		TransferService service = new TransferService();

		// Step 1 --Call method transfer() from TransferService
		// Step 2 --Handle the exception.
		// Step 3 --Print the checking and saving account balance
		try {
			service.transfer(100001);
		} catch (InSufficiantBalanceException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		System.out.println(" Checking account balance :"
				+ service.getCheckingAccountBalance());
		System.out.println(" Savings account Balance  :"
				+ service.getSavingsAccountBalance());

	}

}
